﻿

@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    var keyValue = $.request("keyValue");
    $(function () {
        if (!!keyValue) {
            $.ajax({
                url: "/SystemManage/SysDbBackup/GetFormJson",
                data: { keyValue: keyValue },
                dataType: "json",
                async: false,
                success: function (data) {
                    $("#form1").formSerialize(data);
                }
            });
        }
    });
    function submitForm() {
        if (!$('#form1').formValid()) {
            return false;
        }
        var submitUrl = "Insert";
        if (!!keyValue) {
            submitUrl = "Update";
        }
        $.submitForm({
            url: "/SystemManage/SysDbBackup/" + submitUrl + "?keyValue=" + keyValue,
            param: $("#form1").formSerialize(),
            success: function () {
                $.currentWindow().$("#gridList").trigger("reloadGrid");
            }
        });
        return false;
    }
</script>
@*<form id="form1">
    <div style="padding-top: 30px; margin-right: 30px;">
*@
<form id="form1">
    <div style="margin-bottom: 0; border-radius: 0;" class="alert alert-warning alert-dismissable">
        <strong>注意：</strong>&nbsp;备份成功后，请将备份文件下载到本地保存！
    </div>
    <div style="padding-top: 20px; margin-right: 20px;">
        <table class="form">
            <tr>
                <th class="formTitle">数据库名</th>
                <td class="formValue Value">
                    <select id="DbName" name="DbName" class="form-control required">
                        <option value="LiAnPayFormal">LiAnPayFormal</option>
                    </select>
                    @*<input id="DbName" name="DbName" type="text" class="form-control required" placeholder="" />*@
                </td>
            </tr>
            <tr>
                <th class="formTitle">备份名称</th>
                <td class="formValue Value">
                    @*<input id="FileName" name="FileName" type="text" class="form-control required" value="@La.Core.Common.CreateNo()" placeholder="请输入备份名称" />*@

                    <input id="FileName" name="FileName" type="text" class="form-control required" value="" placeholder="请输入备份名称" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">备份模式</th>
                <td class="formValue Value">
                    <select id="BackupType" name="Backuptype" class="form-control required">
                        <option value="1">完整备份</option>
                        @*<option value="2">差异备份</option>*@
                    </select>
                </td>
            </tr>
            <tr>
                <th class="formTitle" valign="top" style="padding-top: 11px;">
                    备份说明
                </th>
                <td class="formValue Value">
                    <textarea id="Description" name="Description" class="form-control" style="height: 60px;"></textarea>
                </td>
            </tr>
        </table>
    </div>
</form>

